home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.FlowLayout;
- import java.awt.GridLayout;
- import java.awt.Label;
- import java.awt.Panel;
- import java.awt.Scrollbar;
- import java.awt.event.AdjustmentEvent;
- import java.awt.event.AdjustmentListener;
- import java.net.URL;
-
- public class HexColor extends Applet implements AdjustmentListener {
- // $FF: renamed from: wi int
- private int field_0;
- // $FF: renamed from: he int
- private int field_1;
- private Color color;
- // $FF: renamed from: p1 java.awt.Panel
- private Panel field_2;
- // $FF: renamed from: p2 java.awt.Panel
- private Panel field_3;
- // $FF: renamed from: t java.awt.Label[]
- private Label[] field_4;
- // $FF: renamed from: th java.awt.Label
- private Label field_5;
- // $FF: renamed from: s java.awt.Scrollbar[]
- private Scrollbar[] field_6;
-
- public String getAppletInfo() {
- return "Name: HexColor\r\nAuthor: Taiji Software\r\n";
- }
-
- public void register() {
- try {
- URL u = new URL("http://www.taijisoftware.com");
- ((Applet)this).getAppletContext().showDocument(u, "_blank");
- ((Applet)this).stop();
- } catch (Exception e) {
- System.out.println(e);
- ((Applet)this).stop();
- }
- }
-
- public void init() {
- String codeBase = null;
-
- try {
- codeBase = (new URL(((Applet)this).getCodeBase().toString())).getHost();
- System.out.println("Copyright 1999, 2001 Taiji Software(tm)\nYour domain name is : " + codeBase);
- codeBase = codeBase.toUpperCase();
- } catch (Exception var9) {
- }
-
- if (!((Applet)this).getCodeBase().toString().toUpperCase().startsWith("FILE") || ((Applet)this).getParameter("debug") != null) {
- String regCode = ((Applet)this).getParameter("registration_code");
- if (regCode == null) {
- regCode = ((Applet)this).getParameter("reg_domain");
- if (regCode == null) {
- this.register();
- } else {
- if (regCode.length() == codeBase.length() + 4 && !codeBase.startsWith("WWW.")) {
- codeBase = "WWW." + codeBase;
- } else if (regCode.length() == codeBase.length() - 4 && codeBase.startsWith("WWW.")) {
- codeBase = codeBase.substring(4);
- }
-
- char[] chars = new char[codeBase.length()];
- codeBase.getChars(0, codeBase.length(), chars, 0);
- String key = new String("haricot");
- char[] chars2 = new char[key.length()];
- key.getChars(0, key.length(), chars2, 0);
-
- for(int i = 0; i < codeBase.length(); ++i) {
- int j;
- if (i >= key.length()) {
- j = i - key.length() * (i / key.length());
- } else {
- j = i;
- }
-
- chars[i] += chars2[j];
- chars[i] = (char)(chars[i] - chars[i] / 26 * 26 + 97);
- }
-
- String res = new String(chars);
- if (!res.equalsIgnoreCase(regCode)) {
- this.register();
- }
- }
- } else if (!regCode.equals("settevercsedegnamiaj") && !regCode.equals("8078")) {
- this.register();
- }
- }
-
- this.field_0 = ((Component)this).getSize().width;
- this.field_1 = ((Component)this).getSize().height;
- this.field_6 = new Scrollbar[3];
- this.field_4 = new Label[3];
- ((Container)this).setLayout(new GridLayout(1, 2));
- this.field_2 = new Panel();
- this.field_3 = new Panel();
- ((Container)this).add(this.field_2);
- ((Container)this).add(this.field_3);
- this.field_2.setLayout(new GridLayout(4, 3));
- this.field_3.setLayout(new FlowLayout());
- this.field_3.setBackground(Color.black);
- String[] st = new String[]{"red", "green", "blue"};
-
- for(int i = 0; i < 3; ++i) {
- this.field_4[i] = new Label("0", 1);
- this.field_6[i] = new Scrollbar(0, 0, 1, 0, 256);
- this.field_6[i].addAdjustmentListener(this);
- this.field_2.add(new Label(st[i], 1));
- this.field_2.add(this.field_4[i]);
- this.field_2.add(this.field_6[i]);
- }
-
- this.field_2.add(new Label("Hexadecimal", 1));
- this.field_5 = new Label(" ", 1);
- this.field_2.add(this.field_5);
- }
-
- public void adjustmentValueChanged(AdjustmentEvent e) {
- for(int i = 0; i < 3; ++i) {
- this.field_4[i].setText(String.valueOf(this.field_6[i].getValue()));
- this.color = new Color(this.field_6[0].getValue(), this.field_6[1].getValue(), this.field_6[2].getValue());
- this.field_3.setBackground(this.color);
- this.field_3.repaint();
- }
-
- this.field_5.setText("#" + Integer.toHexString(this.color.getRGB()).substring(2));
- }
- }
-